import json
from utils import CommonUtils

filename = r'G:\ututes\Code\tools\ututes_html_process\resources\navigation\index.json'

with open(filename, 'r') as file:
    mapping_list = json.load(file)

program_count = 1
degree_count = 1
for mapping in mapping_list:
    url = mapping.get("url")
    md5 = mapping.get("md5")
    if CommonUtils.TextUtils.contains_word(url, "/programs"):
        print("专业信息", program_count, url)
        program_count += 1
    elif CommonUtils.TextUtils.contains_word(url, "sgs.calendar.utoronto.ca/degree"):
        print("学位课程", degree_count, url)
        degree_count += 1
    else:
        # print("其他文件:", url)
        pass
